<!DOCTYPE HTML><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><? echo $title ?></title>
<? require("lib.php"); ?>
</head>
<body>
<div class="content-box">
    <div class="content-box-header">
        <h3><? echo $title ?></h3>
        <div class="clear"></div>
    </div>
    <div class="content-box-content">
<?
  switch ($do) {
    case "add":
    	add();
    	break;
	case "update":
		update($info);
		break;
	case "delete":
		delete($uid);
		break;
	case "approve":
		approve($uid);
		break;
    default:	
		show_info($info);
  }
 ?>
<? function show_box($row, $iseditmode){ 
	global $id, $title, $h;
?>
	<table width="99%" cellspacing="0" cellpadding="3" class="mbox">
      <tr class="th"><td class="thtitle" width="120" align="right"><? echo $title ?></td><td>
      	<? echo $h->hidden('id', $row["id"]); ?>
      </td></tr>
      <tr><td class="l">账号</td><td><? echo $h->text('username', $row["username"], 'gs') ?></td></tr>
      <tr <? if(!$iseditmode)echo "class='hide'";?> class="hide"><td class="l">原密码</td><td><input name="oldpassword" type="password" class="gs"></td></tr>
      <tr><td class="l">密码</td><td><input name="password" type="password" class="gs"> <span class="gray"> * 6-15个字符为宜.</span></td></tr>
      <tr class="hide"><td class="l">确认输入</td><td><input name="repassword" type="password" class="g"></td></tr>
      <tr><td class="l">&nbsp;</td><td><br><input  name="save" type="submit" value="&nbsp; 保存 &nbsp;">&nbsp;&nbsp;<a onClick="history.go(-1)">[ Back ]</a><br><br></td></tr>
    </table>
    <? } ?>
	<? function show_boxes($result){ 
		global $url;
		$str= '<table width="99%" cellspacing="0" cellpadding="3" class="mlist"><tr class="th"><td><strong>#.</strong></td><td><strong>账号</strong></td><td><strong>最后登录</strong></td><td><a href="'.$url.'.php?do=add">添加管理员</a></td></tr>';
		$count=1;
    	foreach( $result as $row)
		{	
			$id=$row['id'];
      		$color="";
			if($count%2==1)$color=" class='wh'";
      		$str.= "<tr".$color."><td>".$count.".</td><td>".decode($row['username'])."</td><td>".decode($row['last_login_time'])."</td><td><a href=\"$url.php?do=update&id=".$id."\">更改密码</a></td></tr>"; 
			//echo $str;
			$count++;
		}
		$str.= "</table>";
		if($count==1) $str.= "<br>No data now. (暂无数据!)";
		echo $str;
     } ?>
 <br class="clear" />
		</div>
             <br class="clear" />
	</div>
</body>
</html>